/**
 * 浮动价格  不会；思路是什么呢？
 */

var strArray = location.search;
AllIndexStr = strArray.split("?")[1].split("=")[1];

//  获取时间戳
var newTime = timeAll(); // ?? $里面是否能访问的奥

skuId = AllIndexStr.split(',')[0];


var  selected_val=$('#prAdj option:selected').val();//选中的值

var timeDtr='';
// 时间段选择   请选择预约时间段
function selectedVal() {
    var nodeSel1=document.getElementById("prAdj"); //获取select元素
    var index = nodeSel1.selectedIndex; // 选中项的索引
    timeDtr= nodeSel1.options[index].value; // 选中项的文本
    // timeDtr = timeDtr.replace('%','');
    // timeDtr = timeDtr * 100% +1;
    console.log(timeDtr)
}

// 注意；以后通过遍历的方式获取
// var optionArray = document.getElementsByTagName("option");
// optionMoreResult = '';
// sel_float = '';
// for (var j = 0; j < optionArray.length; j++) {
//     if (optionArray[j].selected) {
//         MoreResult = optionArray[j].value;
//         MoreResult = MoreResult.replace('%','');
//         sel_float = MoreResult / 100 +1;
//     }
// }
// var MoreResult = sel_Index.replace('%','')


function ajaxText() {
    var timestamp = 'timeStamp:' + newTime + 'BM'+'skuId:'+skuId+'BM'+'floatValue:'+timeDtr+'BM';
    var signs = md5(timestamp);
    signs = signs.toUpperCase();
    $.ajax({
        type: 'get',
        url: webUrl + "upstreamquotation/adjustPriceByStore",
        data: {
            "timeStamp": newTime,
            "sign": signs,
            "skuId": skuId,
            "floatValue": timeDtr,
        },
        dataType: 'JSON',
        async: false,
        success: function (data) {
            if(data.status == '200'){
                document.location.href = 'referIphonPrices.html';
            } else if (data.status == '300') {
                document.location.href = '../html/login.html';
            } else if(data.status == '500'){
                alert(data.msg)
            }
        }
    });
}

function cancel_float() {
    document.location.href = 'referIphonPrices.html';
}



